function request(url, data = {}, method = "GET") {
  return new Promise(function (resolve, reject) {
      wx.request({
          url: url,
          data: data,
          method: method,
          success: function (res) {
             resolve(res.data.data)

          },
          fail: function (err) {
              reject(err)
          }
      })
  });
}

function get(url, data = {}) {
  return request(url, data, 'GET')
}

module.exports = {
  get
}